package edu.sctu.zhengsenwen.month201505.day20150504;

/**
 * Created by user15 on 2015/5/4.
 */
public class Perfectnum {

    public void setI() {

        int i;
        int n;

        for(i = 2;i <= 1000;i++){
            int sum=0;
            for (n = 1; n <i; n++) {
                if (i%n==0){
                    sum = sum+n;
                }

            }

            if (sum == i) {
                System.out.println(i + "是完数");
            }
        }

    }
}
